#pragma once
#include <iostream>
#include <string>
#include <ctime>
#include <thread>
#include "level.hpp"
#include "util.hpp"
struct Logmsg
{
    
    size_t _line;             // ⾏号
    time_t _ctime;            // 时间
    std::thread::id _tid;     // 线程ID
    std::string _name;        // ⽇志器名称
    std::string _file;        // ⽂件名
    std::string _payload;     // ⽇志消息
    Level ::LevelType _level; // ⽇志等级

    Logmsg() {}
    Logmsg(std::string name,
           std::string file,
           size_t line,
           Level ::LevelType level, std::string payload ) : _name(name),
                                                             _file(file),
                                                             _payload(payload),
                                                             _level(level),
                                                             _line(line),
                                                             _ctime(Date::Now()),
                                                             _tid(std::this_thread::get_id()) {}
};